﻿package com.xuanque.mahjongDice.display
{
	
	import datas.Player;
	
	import flash.display.Sprite;
	import flash.text.TextField;
	
	
	public class ResultItem extends Sprite
	{
		
		private var name_string:String;
		private var prev_string:String;
		private var allNum:Number = 0;
		private var all_string:String;
		
		public function ResultItem(player:Player) {
			
			this.name_txt.text = "";
			this.prev_txt.text = 0 + "";
			this.all_txt.text = 0 + "";
			
			this.name_string = player.getLoginName() + "";
			//this.name_string = player.getLoginName() + "";
			//this.prev_string = player.getSeed() + "";
			//this.allNum +=  player.getSeed();
			//this.all_string = this.allNum + "";
			
			this.name_txt.text = player.getNickName() + "";
			
			
		}
		
		
		
		/**
		 * 上局得分
		 * @return 
		 * 
		*/	
		public function setPrevSeed(num:Number):void {
			
			this.prev_string = num + "";
			
			this.allNum += num;
			this.all_string = this.allNum + "";
			
			this.prev_txt.text = this.prev_string;
			this.all_txt.text = this.all_string;
			
		} 
		
		public function getName():String {
			
			return this.name_string;
		}
		
		
	}
}